package lu.peersoft.util

import java.text.*

/**
 * @author Thor
 *
 */
class Mixins {

    static void mixin() {
        
        ExpandoMetaClass.enableGlobally()
          
        Object.metaClass.concat << { String sep, Closure c -> delegate.collect(c).join(sep) }
        Object.metaClass.concat << { Closure c -> delegate.collect(c).join() }
        Date.metaClass.format << { String fmt -> new SimpleDateFormat(fmt).format(delegate) }      
        Number.metaClass.format << { String fmt -> new DecimalFormat(fmt).format(delegate) }      
        String.metaClass.asDate << { String fmt -> new SimpleDateFormat(fmt).parse(delegate) }      
    }   
    
}
